From ed5b7fedb860fae7ebd72ee83cf3a02fe88ca454 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Fri, 30 Jun 2017 13:08:00 +0200 Subject: [PATCH] scale: Remove custom indicator drawing it's a css node so we can simply use the background instead of the foreground color in the theme. --- gtk/gtkscale.c | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c index 4ee94114b6..ecdcf9a2c1 100644 --- a/gtk/gtkscale.c +++ b/gtk/gtkscale.c @@ -1596,39 +1596,6 @@ gtk_scale_measure (GtkWidget *widget, } } -static gboolean -gtk_scale_render_mark_indicator (GtkGizmo *gizmo, - GtkSnapshot *snapshot) -{ - GtkWidget *widget = GTK_WIDGET (gizmo); - GtkScale *scale = GTK_SCALE (gtk_widget_get_parent (gtk_widget_get_parent (gtk_widget_get_parent (widget)))); - GtkStyleContext *context; - GtkOrientation orientation; - GdkRGBA color; - GtkAllocation allocation; - - gtk_widget_get_content_allocation (widget, &allocation); - - orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (scale)); - context = gtk_widget_get_style_context (widget); - - gtk_style_context_get_color (context, &color); - if (orientation == GTK_ORIENTATION_HORIZONTAL) - gtk_snapshot_append_color (snapshot, - &color, - &GRAPHENE_RECT_INIT(allocation.width / 2, - 0, 1, allocation.height), - "ScaleMark"); - else - gtk_snapshot_append_color (snapshot, - &color, - &GRAPHENE_RECT_INIT(0, allocation.height / 2, - allocation.width, 1), - "ScaleMark"); - - return FALSE; -} - static void gtk_scale_snapshot (GtkWidget *widget, GtkSnapshot *snapshot) @@ -1942,7 +1909,7 @@ gtk_scale_add_mark (GtkScale *scale, mark->indicator_widget = gtk_gizmo_new ("indicator", NULL, NULL, - gtk_scale_render_mark_indicator); + NULL); gtk_widget_set_parent (mark->indicator_widget, mark->widget); if (mark->markup && *mark->markup) { -- 2.30.2